{include file="header.html"}
<body class="gr">

<div class="navBar">
	<a class="left" href="javascript:history.back()"><i class="return"></i></a>
	<div class="titleView-x">立即支付</div>
</div>

<div class="cart-jiesuan main-top">
	<div class="view">
		<div class="title ge-bottom">基本信息</div>
		<div class="row ge-bottom"><span>{$order_data.name}</span><span>姓名</span></div>
		<div class="row ge-bottom"><span>{$order_data.idcard}</span><span>身份证号</span></div>
		<div class="row ge-bottom"><span>{$order_data.city}</span><span>参保城市</span></div>
		<div class="row"><span>{$order_data.type}</span><span>户口性质</span></div>
		
		<div class="ge-top"></div>
		<div class="title ge-bottom">缴纳月份</div>
		<div class="row"><span>{$order_data.month}</span><span>缴费年月</span></div>
		
		<div class="ge-top"></div>
		<div class="title ge-bottom">费用信息</div>
		<div class="row ge-bottom"><span>￥{$order_data.total}</span><span>社保费用</span></div>
		<div class="row ge-bottom"><span>￥{$order_data.gjj_total}</span><span>公积金费用</span></div>
		<div class="row ge-bottom"><span>￥{$order_data.service_money}</span><span>服务费用</span></div>
		<div class="row"><span class="price">￥{$order_data.total_price}</span><span>合计费用</span></div>
	</div>

	<div class="buttonView">
		<a href="javascript:callApi()" class="wx">立即支付</a>
	</div>
</div>

{include file="footer.html"}
<script>
//调用微信JS api 支付
function jsApiCall(){
	WeixinJSBridge.invoke(
		'getBrandWCPayRequest',
		{$data},
		function(res){
			//WeixinJSBridge.log(res.err_msg);
			if(res.err_msg=='get_brand_wcpay_request:ok'){
				location.href = 'wap.php?app=cart&act=order_complete&order_sn={$order_sn}';
			}else{
				//alert('支付失败， 原因：\n'+res.err_desc);
				$('.cart-jiesuan a.wx').html('重新支付');
			}
		}
	);
}

function callApi(){
	if (typeof WeixinJSBridge == "undefined"){
		if( document.addEventListener ){
			document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
		}else if (document.attachEvent){
			document.attachEvent('WeixinJSBridgeReady', jsApiCall);
			document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
		}
	}else{
		jsApiCall();
	}
}

$(function(){
	callApi();
});
</script>